package com.winbomb.simulife.impl;

import com.winbomb.simulife.World;
import com.winbomb.simulife.base.IJob;
import com.winbomb.simulife.base.JobTitle;

public abstract class BaseJob implements IJob {

	protected World world;
	protected JobTitle title;
	protected int salary;

	public BaseJob(World world) {
		this.world = world;
	}

	@Override
	public void cutSalary(int delta) {
		salary -= delta;

	}

	@Override
	public JobTitle getJobTitle() {
		return title;
	}

	@Override
	public int getSalary() {
		return salary;
	}

	@Override
	public void promote() {
		title = title.nextTitle();
	}

	@Override
	public void demote() {
		title = title.preTitle();
	}

	@Override
	public void raiseSalary(int delta) {
		salary += delta;
	}

}
